﻿$(function () {
    $('#authorizationCode').focus(); //当前页面输入框选中

    //主页面快捷键
    $(document).on('keydown', function (e) {
        switch (e.keyCode) {
            case 27:    //ESC操作 
                e.preventDefault();
                var index = parent.layer.getFrameIndex(window.name); //获取窗口索引
                parent.layer.close(index);
                parent.$('#sku').focus();
                break;
            case 13:    //回车
                e.preventDefault();
                var authorizationCode = $('#authorizationCode').val();    //授权码
                var oddNumbers = $('#oddNumbers').val(); //单号
                
                if (authorizationCode == "") {
                        message('message.html?t=31', '600px', '400px');
                    }
                else if (oddNumbers == "") {
                    message('message.html?t=32', '600px', '400px');
                }
                else {
                    parent.window.location.href = "returngoods.html";
                }
               
                break;
        }
    });
});